<!-- $Id: area_list.htm 14216 2008-03-10 02:27:21Z testyang $ -->
{if $full_page}
{include file="pageheader_citytree.htm"}
{insert_scripts files="../js/utils.js,listtable.js,../js/region.js"}
{include file="store_shipping_demo_lib.htm"}
<!-- start category list -->
<div class="list-div">
<table cellspacing='1' cellpadding='3' id='listTable'>
  <tr>
    <th width='80%'>当前仓库：{$store_name}</th>
	<th align='right'>{insert name="get_all_regions" store_id=$store_id}</th>
	<th align='left'><input type="button" value="运费模板" onclick="javascript:showDiv()"></th>
  </tr>
</table>
</div>
<div class="list-div" id="listDiv">
{/if}

<table cellspacing='1' cellpadding='3' id='listTable'>
  <tr><td colspan='2'><input type="checkbox" name="allc" id="allc" onclick="$('.areacb').attr('checked',this.checked);">全选</td></tr><tr>
    {foreach from=$area_arr item=list name=area_name}
      {if $smarty.foreach.area_name.iteration > 1 and ($smarty.foreach.area_name.iteration-1) % 3 eq 0}
      </tr><tr>
      {/if}
      <td class="first-cell" align="left">
	  <form action="" method="post" id="areaform" name="areaform">
	  <table width="100%" cellpadding=0 cellspacing=0 border=0>
	  <tr><td width="50%" align=right style="padding-right:30px;font-weight:bold;">
	  <input type="checkbox" name="areas[]" class="areacb" value="{$list.rec_id}">
       <span onclick="listTable.edit(this, 'edit_store_name', '{$list.store_id}'); return false;">{$list.area_name|escape:"html"}</span>
	   </td><td width="50%">
       <span class="link-span">       
	   <a href="store_manage.php?act=shipping_area_fee&id={$list.rec_id}" title="{$lang.shipping_area_fee}">{$lang.shipping_area_fee}</a>&nbsp;&nbsp;
       <a href="store_manage.php?act=shipping_area_remove&store_id={$store_id}&id={$list.rec_id}" onclick="return confirm('你确认要删除吗？');" title="{$lang.drop}">{$lang.drop}</a>
       </span>
	   </td></tr></table>
	   </form>
      </td>
    {/foreach}
  </tr>
</table>
<br><br>

<!--
<form action="store_manage.php" method="post" name="theForm">
<table cellspacing='1' cellpadding='3' id='listTable2'>
<tr>
    <td align=center>
        <span  style="vertical-align: top">{$lang.label_country} </span>
        <select name="country" id="selCountries" onchange="region.changed(this, 1, 'selProvinces')" size="10" style="width:80px">
          {foreach from=$countries item=country}
          <option value="{$country.region_id}">{$country.region_name|escape:html}</option>
          {/foreach}
        </select>
        <span  style="vertical-align: top">{$lang.label_province} </span>
        <select name="province" id="selProvinces" onchange="region.changed(this, 2, 'selCities')" size="10" style="width:80px">
          <option value=''>{$lang.select_please}</option>
        </select>
        <span  style="vertical-align: top">{$lang.label_city} </span>
        <select name="city" id="selCities" onchange="region.changed(this, 3, 'selDistricts')" size="10" style="width:80px">
          <option value=''>{$lang.select_please}</option>
        </select>
        <span  style="vertical-align: top">{$lang.label_district}</span>
        <select name="district" id="selDistricts" onchange="region.changed(this, 4, 'selXiangcuns')"  size="10" style="width:130px">
          <option value=''>{$lang.select_please}</option>
        </select>
		<span  style="vertical-align: top">{$lang.label_district}</span>
        <select name="xiangcun" id="selXiangcuns"  size="10" style="width:130px">
          <option value=''>{$lang.select_please}</option>
        </select>
		
		
        <span  style="vertical-align: top">
		<input type="hidden" name="parent_id" value="{$store_id}">
		<input type="button" value="+" class="button" style="cursor:pointer;" onclick="addRegion()" /></span>
    </td>
  </tr>
  </table >
  </form>
 -->

{if $full_page}
</div>

{literal}
<script language="JavaScript">
<!--
region.isAdmin = true;
onload = function() {
  // 开始检查订单
  startCheckOrder();
}

/**
 * 新建区域
 */
function addRegion()
{
	var parent_id = Utils.trim(document.forms['theForm'].elements['parent_id'].value);
    var province = Utils.trim(document.forms['theForm'].elements['province'].value);
    var city   = Utils.trim(document.forms['theForm'].elements['city'].value);
	var district   = Utils.trim(document.forms['theForm'].elements['district'].value);
	var xiangcun   = Utils.trim(document.forms['theForm'].elements['xiangcun'].value);

    if (province.length == 0 || city.length == 0)
    {
        alert('省份或城市不能为空');
    }
    else
    {
      Ajax.call('store_manage.php?is_ajax=1&act=add_shipping_area',
        'parent_id=' + parent_id + '&province=' + province+ '&city=' + city+ '&district=' + district+ '&xiangcun=' + xiangcun,
        listTable.listCallback, 'POST', 'JSON');
    }

    return false;
}

//-->
</script>
{/literal}



{include file="pagefooter.htm"}
{/if}